import axios from './http.js'
import _ from 'lodash'

/**
 *
 * 主播信息，包括招募和运营
 */

// 获取平台列表
export function getPlatform(config) {
  const url = '/bs/platform/list'
  const opts = _.merge({ headers: { isLogin: false }}, config || {})
  return axios.get(url, opts)
}

// 提交第一步
export function addActorStep1(data, config) {
  const url = '/cs/anchor/submit1V2'

  data = data || {}
  config = _.merge({ headers: { isLogin: false }}, config || {})
  return axios.post(url, data, config)
}
// 提交第二部
export function addActorStep2(data, config) {
  const url = '/cs/anchor/submit2V2'

  data = data || {}
  config = _.merge({ headers: { isLogin: false }}, config || {})
  return axios.post(url, data, config)
}
// 浏览次数统计
export function visit(data, config) {
  const url = '/cs/anchor/visit'
  data = data || {}
  config = _.merge({ headers: { isLogin: false }}, config || {})
  return axios.post(url, data, config)
}
// 上传视频
export function uploadVideo(data, config) {
  const url = '/bs/upload'

  data = data || {}
  config = _.merge(
    { headers: { isLogin: false, 'Content-Type': 'multipart/form-data' }},
    config || {}
  )
  return axios.post(url, data, config)
}

// 获取才艺列表
export function getSkillList(config) {
  const url = '/bs/skill/list'
  const opts = _.merge({ headers: { isLogin: false }}, config || {})

  return axios.get(url, opts)
}

// 获取才艺列表
export function getPlatfomDocList(config) {
  const url = '/bs/platform/h5/listByChannelId'
  const opts = _.merge({ headers: { isLogin: false }}, config || {})

  return axios.get(url, opts)
}
